<!--
 * @Author: your name
 * @Date: 2020-12-28 17:53:01
 * @LastEditTime: 2020-12-29 14:27:17
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \basicvue\vuehtml\vueindex.html
-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../assets/css/common.css">
    <link rel="stylesheet" href="../assets/css/vue.css">
    <script src="../assets/js/vue.js"></script>
</head>
<body>
<div id="app">
    <a href="../index.html" class="retu">BACK</a>
    <h1>注册组件</h1>
    <hr>
    <jspang></jspang>
    <hr>
    <panda></panda>

</div>
<script type="text/javascript">
    //注册全局组件
    Vue.component('jspang',{
        template: `<div style="color: red;">全局注册的jspang标签</div>`
    });

    //局部注册就是写在构造器中
    var app = new Vue({
        el : "#app",
        data:{

        },
        //局部注册组件布局
        components:{
            "panda" : {
                template: `<div style="color: red;">局部注册的panda标签</div>`
            }
        }
    });


</script>
</body>
</html>